﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NHibernate;
using Advisor.Entities;
using System.Reflection;

namespace rm_Advisor
{
  public partial class DefaultGUI : ComponentFactory.Krypton.Toolkit.KryptonForm
    {
        private Users m_User;
        public DefaultGUI(Users user)
        {
            InitializeComponent();
            this.m_User = user;
            this.lbLoggedUser.Text = user.Login; 
        }

        public DefaultGUI()
        {
            InitializeComponent();
            this.footerVersion.Text =  Assembly.GetExecutingAssembly().GetName().Version.ToString();
            this.footerDate.Text = Convert.ToString(DateTime.Now);
        }


        private void históricoToolStripMenuItem_Click(object sender, EventArgs e)
        {
          EditRisk editRisk = new EditRisk();
          editRisk.ShowDialog();
            
        }

        private void usuárioToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            UserGUI uGUI = new UserGUI(this.m_User);
            uGUI.ShowDialog();
        }

        private void Default_Load(object sender, EventArgs e)
        {
            Login lg = new Login();
            lg.ShowDialog();
            if (lg.DialogResult == DialogResult.OK)
            {
                this.m_User = lg.users;
                this.lbLoggedUser.Text = lg.users.Login;
                
            }
            else
            {
                this.Close();
            }
            
        }

        private void sobreToolStripMenuItem_Click(object sender, EventArgs e)
        {
            AboutBox Abox = new AboutBox();
            Abox.ShowDialog();
        }

        private void projectToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ProjectGUI Proj = new ProjectGUI(this.m_User);
            Proj.ShowDialog();
        }

        private void membrosToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            MemberGUI mGUI = new MemberGUI(this.m_User);
            mGUI.ShowDialog();
        }

        private void matrizDeImpedimentosToolStripMenuItem_Click(object sender, EventArgs e)
        {
            ImpedimentsMatrixGUI impGUI = new ImpedimentsMatrixGUI(this.m_User);
            impGUI.ShowDialog();
        }

        

        

    }
}
